#ifndef _JTAG_H_
#define _JTAG_H_

#include "../../Component.h"
#include<avr/io.h>
#include<avr/interrupt.h>
#include "../../../bit/bit.h"

namespace Hardware
{
namespace Avr
{

	typedef struct JTAG_CONFIG
	{
		unsigned char jtagDisable : 1;
		unsigned char jtagResetFlag : 1;
		
	} JtagConfig;

	typedef struct JTAG_DATA
	{
		unsigned char data : 8;
	} JtagData;

	class Jtag : public Component<JtagConfig, JtagData>
	{
		public :

		
		Jtag(){}
		Jtag(JtagConfig c){configuration=c;}
		void config()
		{	
			//set jtag disable
			MCUCSR = SetBit(MCUCSR, JTD, configuration.jtagDisable);
			//set jtag reset flag
			MCUCSR = SetBit(MCUCSR, JTRF,
					 configuration.jtagResetFlag);
		}
		void run(){}
	};
}
}




#endif
